line Derived Type

type, public :: line

Defines the parametric form of a line .


Contents


Components

Type Visibility Attributes Name Initial
real(kind=real64), public :: r0(3)

The coordinates of the initial point .

real(kind=real64), public :: v(3)

The vector defining the orientation of the line.


Constructor

public interface line

  • private pure function line_from_2pts(pt1, pt2) result(rst)

    Constructs a line from two points.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(in) :: pt1(3)

    The first point. This point will act as the initial point along the line such that in the equation of the line .

    real(kind=real64), intent(in) :: pt2(3)

    The second point.

    Return Value type(line)

    The resulting line.

  • private pure function line_from_2_planes(p1, p2) result(rst)

    Constructs a line from the intersection of two planes.

    Arguments

    Type IntentOptional Attributes Name
    class(plane), intent(in) :: p1

    The first plane.

    class(plane), intent(in) :: p2

    The second plane.

    Return Value type(line)

    The resulting line. NaN's are returned in the event that the two planes are parallel.

  • private pure function line_from_many_points(pts) result(rst)

    Constructs the line that best fits the supplied set of points in a least-squares sense.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(in), dimension(:,:) :: pts

    An N-by-3 matrix where N is at least 2, but typically much larger.

    Return Value type(line)

    The resulting line.


Type-Bound Procedures

procedure, public :: evaluate => line_eval

  • private pure function line_eval(this, t) result(rst)

    Evaluates the equation of the line at the specified parameter.

    Arguments

    Type IntentOptional Attributes Name
    class(line), intent(in) :: this

    The line.

    real(kind=real64), intent(in) :: t

    The parameter.

    Return Value real(kind=real64), (3)

    The location along the line defined by the parameter .